project(TYPECHECKER_TEST)

set(ARKTSCONFIG_PATH "${CMAKE_CURRENT_BINARY_DIR}/arktsconfig.json")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/arktsconfig.json.in" "${ARKTSCONFIG_PATH}")

run_panda(
    TARGET_NAME typechecker_test
    ARKTSCONFIG "${ARKTSCONFIG_PATH}"
    SRC_FILE_NAME "TypeChekerTest.ets"
    EXTRA_BOOT_PANDA_FILES
        "${TYPE_CHECKER_BINARY_DIR}/TypeCheckerTypeof.abc"
        "${TYPE_CHECKER_BINARY_DIR}/FastTypeChecker.abc"
        "${MEASURE_NATIVE_LIB_BINARY_DIR}/MeasureNativeLib.abc"
    ADDITIONAL_OPTIONS
        "--compiler-enable-jit=false"
        "--native-library-path=${MEASURE_NATIVE_LIB_BINARY_DIR}"
        # "--log-components=AOT:classlinker:runtime:interpreter"
        #"--log-components=classlinker"
        "--log-components=AOT"
        "--log-level=info"
    EXTRA_DEPS
        measure_native_lib_srcs
        type_checker_srcs
    AOT
    MAKE_EXTRA_AOT_FILES
        "${TYPE_CHECKER_BINARY_DIR}/TypeCheckerTypeof.abc"
        "${TYPE_CHECKER_BINARY_DIR}/FastTypeChecker.abc"
        ${ETSSTDLIB_ABC}
)
